<template>
  <div>
    <el-tabs v-model="activeName">

      <el-tab-pane name="first">
        <div slot="label" @click="myAuthorityAccountClick">发送的申请</div>
        <my-authorityAccount ref="myAuthorityAccount"></my-authorityAccount>
      </el-tab-pane>

      <el-tab-pane name="second">
        <div slot="label" @click="recieveAuthorityAccountClick">接收的申请</div>
        <recieve-authorityAccount ref="recieveAuthorityAccount"></recieve-authorityAccount>
      </el-tab-pane>

    </el-tabs>
  </div>
</template>
<script>
  import MyAuthorityAccount from './module/authorityAccount/send-authorityAccount'
  import RecieveAuthorityAccount from './module/authorityAccount/receive-authorityAccount'
  export default {
    data() {
      return {
        activeName: 'first'
      }
    },
    components: {
      MyAuthorityAccount,
      RecieveAuthorityAccount
    },
    activated() {
      this.myAuthorityAccountClick()
    },
    methods: {
      myAuthorityAccountClick() {
        this.$nextTick(() => {
          this.$refs.myAuthorityAccount.getDataList()
        })
      },
      recieveAuthorityAccountClick() {
        this.$nextTick(() => {
          this.$refs.recieveAuthorityAccount.getDataList()
        })
      }
    }
  }
</script>